Changing Main Character's Apperance
Introduction Difficulty: Normal This tutorial will show you the most glitch-proof way to change Geralt's apperance without replacing the default one, but adding alternatives instead. Pros * Apperances can be easily switched between with few clicks. * Working inventory, magic, character screen and animations. * The easiest and the least confusing (to use after it's been set up) method if you are developing multiple mods at once. * Works with most models, provided their anatomy isn't much different from Geralt's. Downsides * If you want to get the models' armor aswell, it will overlap with the stuff your character is wearing. * If you want to change just the head, it won't always fit. * Forget about different haircuts for your character (atleast for now) - changing your hairstyle will just spawn Geralt's hair and it will overlap with your model's hair (unless he's bald). * It is not perfect for female models, as a lot of the stuff was designed for a male character - the armor pieces look weird on a female and you will hear Geralt's screams when swinging a sword, so you will have to replace the sounds aswell. And the armor meshes. * A bit complicated (but then again, what isn't in REDkit?). Credits * Unelith (me) of course * kosa89 for providing a starting point for this method * 27_mosaic for describing how to properly transfer body parts Getting Started First you need to think what are you trying to achieve. If your goal is to temporarily turn into an NPC (like it was done with Henselt in the original campaign) and you don't need the player to open the inventory/use magic - there is a simpler way, that I will describe aswell, just not right now. If you need all the forementioned stuff (working inventory, etc.) - don't stop reading. Of course I am assuming that you have a more or less polished working world, it doesn't even have to be pretty, [optional: you know how to set up a basic quest that does stuff when you launch your level], you know how to use the REDkit interface and how to manage files in the Asset Browser. If you don't, then take a look at some beginner tutorials. I will do all the stuff for this tutorial on a basically empty world, so don't expect to see any atleast decent landscapes. One more thing - save often. When you're working on entity templates, press that save button. When you're working on your quest, go to File > Save, and then File > SaveAll, just to make sure. REDkit likes to crash a lot. You have probaly heard that already, but not enough emphasis can be put on it. Step 1: Copying the head model # In Asset Browser, go to characters > templates > witcher. # Copy the "witcher" entity template and paste it somewhere else - preferably somewhere inside your world's folder. I recommend using the Paste as option to rename the duplicate for easier identification later on. I will go with the name "witcher_alt". # Open the "witcher_alt" file. Now let's say I want to use Iorveth's head. We need to find his mimics file. Those can typically be found in characters > main_npc > (character's folder) > mimics, or characters > common > heads. # Select the found file. In Iorveth's case it's "iorveth_mimics". Important: It's the entity template one! # Go back to the opened "witcher_alt". Open the Template properties tab, and click the [' '+ ] button. The path to "iorveth_mimics" should be added to the Included templates list. #* Switch to the Apperances tab. Press the small +''' button above the apperances list to create a new one, and call it for instance "iorveth". Select it from the list, tick '''[ √ ] it, then tick the "Collapse ears in selected apperance" option (I don't know what it does, I ticked it because it's ticked in the default Geralt apperance). Also tick the three elements on the list below: "effect_ard", "full_body_fx''", "''quen_fx", or the visual effects may not be displayed correctly on your character, then expand the list next to "Choose" and select the just recently added Ioverth's head (probably will be called "head_1" here). You will see a floating head pop up in the preview area. #* There are two sub-tabs: Body and Equipment. Go to the Equipment tab. Now look at how it's set up in the "default" apperance by selecting it from the list on the left. You will need to add the same categories to the "iorveth" one, with initially the same settings (explained below). New equipment categories are added using the [ + ] button. #* CAUTION! Sometimes the stuff in the Equipment tab doesn't change as you select another apperance. In that case, just switch between different apperances a few times and it should finally work. # After adding a new, empty category, select it from the list and set it's properties, so that they match the ones connected to the "default" apperance - specifically the "category" field. The "initializer" should be set to the "CEqupimentInitializerUniform" option - then you can pick the default armor set by yourself, by modifying the "itemName" field and see how it will look in the preview window. (I haven't tested whether the "(...)Random" one works and if it does - how exactly). The "defaultItemName" is the mesh that will be displayed if nothing is worn, while "itemName" is the item that is equipped initially (and can be un-equiped by the player). #* In the "hair" category, always set the "defaultItemName" and "itemName" to None. Geralt's hair don't fit most of the times, so we don't want to leave it. You can basically disable everything like this (with the exception of "steelsword" and "silversword") if you want to get the character's unique armor into the model, because it will overlap with Geralt's armor pieces otherwise. Of course if your character puts some armor during the game, it will happen anyway, so you will have to work around this, for instance by creating new armors that don't have a model, so that they provide statistics but don't change the apperance, or by creating new, fitting meshes that don't screw everything up. All in all - it depends on the model. Some heads will fit perfectly, some won't. #* As you can see, Iorveth's head doesn't fit any of this stuff too well, as the neck is missing. That means we have to transfer the rest of his model aswell. Step 2: Transfering the remaining body parts Keep in mind that you don't have to transfer literally the entire model. It is divided into different parts - you can transfer just those parts that you want. In Iorveth's case, you can copy everything, you can leave out stuff like the knife or the quiver, or if the missing neck doesn't look too bad in your opinion - just copy the hats so that atleast his head is complete, and then set the rest of the outfit like I described in the last step. # Find Iorveth's model in the Asset Browser. It's an entity template called "iorwerth_man" and should be located one level above the mimics file (that is: characters > main_npc > iorweth__man). Open it (we won't be editing it, just copying from it) and go to the Body parts tab. # You see a list of all the transferable parts (one exception: "_fx_veins" is not to be copied). Select one of them to see how it exactly looks. Notice that some of them complete nicely with the others, but some are also just different versions of one thing and you should just pick one. For example - don't copy both hats. #* There are also body parts, that consist of more than one model. In this case, the "body" includes "body_1" and "legs_1". You can see that by looking at what's ticked on the "Components in selected body parts state" list. # When you finally decide what do you want to copy, find it on the... map... thing... whatever it is called. I'm talking about that dark area, under the Main tab, placed above all that configuration stuff - in the upper-right corner. I'll call that the "main area" from now on. Right click it, and then Copy. #* Now look at that "Components in selected body parts state" list on the right. Find your body part there and try to remember what's in the brackets ( ) next to it's name. # Go back to the window with the "witcher_alt" file opened. Right click somewhere on the main area (not on one of the components). #* And this is where REDkit may be a pain in the a**. It may just refuse to pop up the context menu for some reason, what is usually combined with a white trail beginning by the "Character" component, that's following your mouse pointer. If that happens, try to right click the "Character" component and with the context menu still open, right click the main area again. That should pop-up a large list. Pick the first option - "Show all" to [ √ ] '''or untick it - doesn't really matter, just click it. That will cause the "head_1" component to appear and will also get rid of this annoying glitch. If it happens again - just do this paragraph again. #* Now you can right click the main area again and paste the body part that you have copied in point 3. In my case it was a variation of the hat, specifically "hat_2". It may differ in your case, but to make things simplier, I will just refer to it as "hat_2". # Connect the "Character" component wth the "hat_2" component by dragging a line (left click and hold) from that little orange circle near it. #* A context menu pops up. In point 3, I have told you to remember some stuff. Now you need to pick one of the options based on what was written in those brackets. If it was "CRagdollMeshComponent" - select "CRagdollAttachment". If '''not - select "CMeshSkinningAttachment". # Repeat points 3-5 for each body part you want to copy. I, for instance, copied the body, the knife, the hat and the skirt/dress. The default Geralt legs and boots fit well, so I didn't copy Iorveth's legs. # In the "witcher_alt" window, go to the Body parts tab aswell. Click the +''' button to add a new body part. Let's call it "body_iorveth". # Select the "body_iorveth" bodypart and on the "Components in selected body parts state" list, '''[ √ ] all the parts that you want the final "iorveth" apperance to contain, but don't tick the head! # Go back to the Apperances tab. Select the "iorveth" apperance, and then go to the Body sub-tab (instead of Equipment). Tick "body_iorveth" on the list below. Then go to the "default" apperance, and make sure that "body_iorveth" is un-ticked, as we don't want the default Geralt model to contain all that stuff we've just imported. # Save the "witcher_alt" file. You can close it now. Step 3: Using the modified entity template # Go to characters > templates > witcher. There is an enity template called "player". Find it physically on your HDD, using the Windows explorer. The path is basically the same: (your Witcher 2 install directory)\data\characters\templates\witcher\player.w2ent. Then back it up somewhere, so that you can restore the original version if you screw this one up. If that's the case, your original game won't be affected, but it is used by REDkit and will probably be cooked into your final mod package, so you may have weird things happen to your character when testing a world. # Open this file in REDkit (the original one, not the backup of course). Go to the Template properties tab. Select "characters\templates\witcher\Witcher.w2ent" from the "Included templates" list and delete it using the [ X ] button. # Find your "witcher_alt" file in the Asset Browser and select it, then go back to the "player" file, and add it to that list using the [ + ] button. Save the file. Final: Changing the apperance # Open the "player" file. # Go to the Apperances tab and tick just the apperance that you want to use (in this case - "iorveth"). Untick all the remaining ones. # Go to the Voicetags tab. There should be one row, with Voicetag set to GERALT. Change the Apperance in this row to the one that you want to use (for example "iorveth"). #* CAUTION! NEVER save an entity template with the Voicetags tab open! It seems to me like it has a 70% chance of crashing REDkit immediatly. So switch to a different tab first, and then Save. # Go to characters > templates > witcher. Find the "witcher_inventory" entity template there. Copy that file somewhere near your "witcher_alt", or whenever you want, naming it for example "witcher_inv_iorveth". # Open the "witcher_inv_iorveth" file. # Go to the Inventory tab. Remove all the stuff that you don't want to be given to the player at the beginning, by selecting it and pressing the [ X ] button. It's the most important to remove "hair:default_geralt_hair" and "hair:hair_leather_armour_01", otherwise Geralt's hair will show up and stick to your character when you equip armour. #* Don't delete the items in the magic slot or it will screw up the signs. #* I'm not sure what ghost or "petard:Bomb Target Marker" do, but I'd recommend not touching it either. #* You can later come back here and remove steel_scabbard and silver_scabbard items in case the scabbard models don't look good in the game. #* In case you're wondering, those items that you put in the "itemName" fields at the Apperance > Equipment tab in that "player" entity template have the priority over this. For instance, if you add Sword X there, and here in the Inventory you add Sword Y in the same slot, your character will have Sword X equipped by default, while Sword Y will be in the inventory, unequiped. #* Hit Save when you're done. # Now, there are two ways to do the last part. Just don't combine these two! You should stick to just one method or it may get confusing. Look up both of them and choose, then do stuff. Editing the custom witcher template # Find and open your "witcher_alt" file. Make sure that "witcher_inv_iorveth" is selected in the Asset Browser. # Go to the Template properties tab. Remove "characters\templates\witcher\witcher_inventory.w2ent" from the list, and then add the selected file like before with the [ + ] button. # Hit save and close the file. That's it. You're done. Run the level. #* If you want to change the apperance back to Geralt ("default"), just repeat the entire Final step of this tutorial, only you don't have to create a new inventory template for Geralt - use the original "witcher_inventory" file that you copied earlier, but don't modify it'' - ignore points 4-6', just '''remove the current' inventory template from the Template properties tab and add the original "'''''witcher_inventory" one (like in point 2 above). #* In case of switching to another alternate apperance (let's say you add Roche's model the same way), you do it exactly the same way as with (in this case) Iorveth. Do the entire Final step, including doing a new inventory template for Roche, or whoever's model you used. Using the scripts # Go back to the "witcher_inv_iorveth" file and open the Inventory tab again. With this method, the character will have only these items that are included here - the equpiment set in the "player" file won't be applied! So make sure that it will contain everything you want. # As you see, every item has the "mount" property. Tick it (set it to true) if you want the item to be equipped by default. You don't have to do this to all that "magic" or "ghost" stuff, just for the swords and the armor pieces. Save the file when you're done. # You need to have a Quest that launches when the map loads. Open it. # Add a Character Customizer node (right click on the grey area, Gameplay > Character Customizer). Connect it's in to your Start node. #* You can link other stuff to the out aswell, so that it will happen after everything is set - I, for one, set my Teleport and Script FadeIn nodes to do things after the inventory is changed. It works really well this way, because the player is sure not to see any side effects of this process. # Select your Charcter Customizer. In the properties on the left, there is the "operations" field, that can contain multiple elements. We will need two of these - one to clear the default inventory and the second one to apply the inventory template we just made. Press the green [ + ] twice to add two empty values. Make sure that the "actorTag" is set to PLAYER. # Set the first added element to CCCOpClearInventory. This one has no additional settings so we can move on to the second element. Set the second one to CCCOpCustomizeInventory, then make sure that "applyMount" is set to true. Now we're gonna set the template property. Select the "witcher_inv_iorveth" in the asset browser, go back to the quest editor and then press the green arrow button. # Save the quest. That's it. You can run the test. #* If you want to switch to Geralt, you don't need any character customizers in your quest. If you have these two that you created in the few last steps - remove them from your quest and save the quest file. Then do the points 1-3 of Final step. #* In case of switching to another alternate apperance (let's say you add Roche's model the same way), you do it exactly the same way as with (in this case) Iorveth. Do the entire Final step, including doing a new inventory template for Roche, or whoever's model you used. Category:Tutorials Category:Scripting